<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-wisDataGroup-edit" th:object="${wisDataGroup}" autocomplete="off">
			<input id="id" name="id" th:field="*{id}" type="hidden">
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="red">*</span>同步组组名：</label>
				<div class="col-sm-4">
					<input id="groupName" name="groupName" th:field="*{groupName}" class="form-control " readonly type="text" >
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="red">*</span>同步数据源：</label>
				<div class="col-sm-4">
					<input id="sourceaName" name="sourceaName" class="form-control" readonly type="text" th:field="*{sourceaName}">
				</div>
				<label class="col-sm-2 control-label"><span class="red">*</span>目标数据源：</label>
				<div class="col-sm-4">
					<input id="sourcebName" name="sourcebName" type="text" class="form-control" readonly th:field="*{sourcebName}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="red">*</span>同步表名称：</label>
				<div class="col-sm-4">
					<input id="tabName" name="tabName" class="form-control" readonly th:field="*{tabName}" type="text">
				</div>
				<label class="col-sm-2 control-label"><span class="red">*</span>目标表名称：</label>
				<div class="col-sm-4">
					<input id="targetName" name="targetName" class="form-control" readonly th:field="*{targetName}" type="text">
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label">同步组状态：</label>
				<div class="col-sm-4">
					<label class="radio-box"><input type="radio" value="1" th:field="*{state}" id="state1" name="state">启用</label>
	                <label class="radio-box"><input type="radio" th:field="*{state}" value="0" id="state2" name="state">停用</label>
				</div>
				<label class="col-sm-2 control-label"><span class="red">*</span>同步策略：</label>
				<div class="col-sm-4">
	                <select id="syncWay" name="syncWay" class="form-control" th:field="*{syncWay}" required>
						<option value="">--请选择--</option>
						<option value="0">同步表数据写入目标表</option>
						<option value="1">目标表数据写入同步表</option>
						<option value="2">双向写入</option>
					</select>
				</div>
			</div>
			
			
			<div class="form-group">
	            <div class="col-sm-12">
	                <div class="ibox float-e-margins">
	                    <div class="ibox-title">
	                        <h5 class="ibox-title-h5 "><a href="javascript:editCol_edit();">编辑字段</a></h5>
	                        <h5 class="ibox-title-h5 activite" style="margin-left: 5px;"><a href="javascript:;">查看字段</a></h5>
	                        <div class="ibox-tools">
	                            <a class="collapse-link">
	                                <i class="fa fa-chevron-up"></i>
	                            </a>
	                            <a class="dropdown-toggle  add-column-item"  href="javascript:;">
	                                <i class="fa fa-plus"></i>
	                            </a>
	                        </div>
	                    </div>
	                    <div class="ibox-content" style="padding:  0px 0px 0px">
	                        <table class="table table-bordered data-tr">
	                            <thead>
	                                <tr>
	                                    <th style="width: 3%;">序号</th>
	                                    <th style="width: 8%;">同步表</th>
	                                    <th style="width: 10%;">字段名称</th>
	                                    <th style="width: 10%;">字段描述</th>
	                                    <th style="width: 8%;">字段类型</th>
	                                    <th style="width: 8%;">字段默认值</th>
	                                    <th style="width: 8%;">目标表</th>
	                                    <th style="width: 10%;">目标字段名称</th>
	                                    <th style="width: 10%;">目标字段描述</th>
	                                    <th style="width: 8%;">目标字段类型</th>
	                                    <th style="width: 8%;">目标字段默认值</th>
	                                    <th  style="width: 5%;" title="字段是否是关联字段">关联字段</th>
	                                </tr>
	                            </thead>
	                            <tbody>
	                            	<tr th:each="colItem,colStat:${wisDataColList}" >
	                            		<td>[[${colStat.count}]]</td>
	                            		<td>[[${wisDataGroup.tabName}]]</td>
	                            		<td>[[${colItem.colName}]]</td>
	                            		<td>[[${colItem.colDesc}]]</td>
	                            		<td>[[${colItem.colType}]]</td>
	                            		<td>[[${colItem.dvalueStr}]]</td>
	                            		<td>[[${wisDataGroup.targetName}]]</td>
	                            		<td>[[${colItem.targetCol}]]</td>
	                            		<td>[[${colItem.targetDesc}]]</td>
	                            		<td>[[${colItem.targetType}]]</td>
	                            		<td>[[${colItem.tdvalueStr}]]</td>
	                            		<td>[[${colItem.linkedCol == 1 ? '是' : '否'}]]</td>
	                                    
	                            	</tr>
	                               
	                            </tbody>
	                        </table>
	
	                    </div>
	                </div>
	            </div>
            </div>
            
            
            <div class="form-group">
	            <div class="form-control-static col-sm-offset-10 buttonleft">
	                <button onclick="close_this_tab()" class="btn btn-danger" type="button">关闭</button>
	            </div>
        	</div>
        
		</form>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript">
		var prefix = ctx + "quartz/wisDataGroup"
		
		
		function close_this_tab() {
			parent.$('.page-tabs-content').find('.active i').trigger("click");
		}
		
		function editCol_edit() {
			var id = '[[${wisDataGroup.id}]]' ;
			var url = prefix + "/editWidthCol/"+id ;
			var currentId = parent.$('.page-tabs-content').find('.active').attr('data-id');
        	var target = parent.$('.Svs_iframe[data-id="' + currentId + '"]');
        	target.attr('data-id',url) ;
        	parent.$('.page-tabs-content').find('.active').attr('data-id',url) ;
            target.attr('src', url).ready();
			$.modal.refreshTab() ;
		}
		
	</script>
</body>
</html>
